function y=permute_no_reps(vals,cnt,kill_reps)
% function y=permute_no_reps(vals,cnt,[kill_reps])
% vals= how many values do you have?
% cnt = how many do you want per trial
% kill_reps = remove trials with internal repetition {e.g. 1,1,3}, [true]
% 6 possible colors, 3 per trial
% y=permute_no_reps(6,3)
% ~bcoe
if nargin<3
    kill_reps=true;
end
if cnt>vals
    error('cnt>vals %d>%d',cnt,vals)
end
x=(1:vals)';
y=x;
for ii =2:cnt
    y=[repmat(y,length(x),1) sort(repmat(x,size(y,1),1))];
end
if kill_reps
    yy=sort(y,2);
    reps=any(diff(yy,[],2)==0,2);
    y(reps,:)=[];
end
y=y(randperm(size(y,1)),:);
